package com.ujs.leetcode.reverseString;

/**
 * @author zhangshihao
 * @create 2023-10-19 20:09
 */
public class ReverseString {
    public static void reverseString(char[] s) {
        int left = 0, right = s.length - 1;
        while (left != right) {
            if (left > right) {
                break;
            }
            char temp = s[left];
            s[left] = s[right];
            s[right] = temp;
            left++;
            right--;
        }
    }

    public static void main(String[] args) {
        // char[] s = new char[]{'h', 'e', 'l', 'm', 'l', 'o'};
        char[] s = new char[]{'h', 'e', 'a', 'l', 'o'};
        System.out.println((s[0] ^ s[1]) ^ s[1]);
    }
}
